package com.zzhardy.controller.admin.permission.dao;

import java.util.List;

import com.zzhardy.controller.admin.permission.model.SysMenu;
import org.beetl.sql.core.annotatoin.Sql;
import org.beetl.sql.core.annotatoin.SqlResource;
import org.beetl.sql.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

@Repository
@SqlResource("admin.permission.sysMenuDao")
public interface SysMenuDao extends BaseMapper<SysMenu> {
    /**
     * 根据层级与parentId获取数据
     */
    @Sql("select * from sys_menu where unit_id = ? and sys_id = ? and level = ? and parent_id = ? and state = ? order by order_num asc")
    List<SysMenu> getMenuByLevelAndParentId(int unitId, int sysId, int level, int parentId, int state);
    
    @Sql("select * from sys_menu where  parent_id = ?")
    List<SysMenu> getMenuByParentId(int parentId);

}
